
function resolvMenu(root,temp,item){ 
    var m=getMenuBean(item);   
    m=resolvTemp(temp,m); 

    if(item.parentId==null){     
        root.children.push(m);
    } else {
        if( temp[item.parentId]){
            temp[item.parentId].children.push(m);
        }else{
            temp[item.parentId]={id:item.parentId,title:"",url:"",icon:"",children:[]}
            temp[item.parentId].children.push(m);
        }
    }
}

function resolvTemp(temp,m){
    if(temp[m.id]){
        temp[m.id]["url"]=m["url"];
        temp[m.id]["title"]=m["title"];
        temp[m.id]["icon"]=m["icon"];
    }else{
        temp[m.id]=m;
    }
    return temp[m.id];
}

function getMenuBean(item){
    return {id:item.id,title:item.title,url:item.url,icon:getMenuIcon(item.title),children:[]};
}

function getMenuIcon(title){
    if(sysMenuIcon[title]){
        return sysMenuIcon[title];
    }
    return "";
}